package com.sc.nft.service;

import com.sc.nft.entity.MallOrder;
import com.sc.nft.entity.MallPayOrderRecord;
import com.sc.nft.entity.WxMiniUserInfo;
import com.sc.nft.entity.vo.mall.MallWxPayVO;
import com.sc.nft.vo.wxPay.PrepayWithRequestPaymentResponse;
import com.sc.nft.vo.wxPay.RefundNotification;
import com.sc.nft.vo.wxPay.Transaction;
import org.springframework.http.ResponseEntity;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 微信支付记录创建
 *
 * @Author：LiGen
 * @Package：com.sc.nft.service
 * @Project：sc_metago
 * @name：WxMiniPayService
 * @Date：2024/5/16 21:38
 * @Filename：WxMiniPayService
 */
public interface WxMiniPayService {

    /**
     * 微信小程序支付记录初始化
     *
     * @param mallOrderList
     * @param wxMiniUserInfo
     * @return
     */
    MallPayOrderRecord PayOrderInitialize(List<MallOrder> mallOrderList, WxMiniUserInfo wxMiniUserInfo, Date now, String ip, BigDecimal totalAmount);

    /**
     * 微信小程序支付
     *
     * @param orderIds
     * @param wxMiniUserInfo
     * @param ip
     * @return
     */
    PrepayWithRequestPaymentResponse wxMiniPrepay(List<Long> orderIds, WxMiniUserInfo wxMiniUserInfo, String ip);


    /**
     * 商户订单号查询订单
     *
     * @param payOrderId 商户订单号
     * @return 支付结果
     */
    MallWxPayVO queryWxMiniPayByOutTradeNo(Long payOrderId);

    /**
     * 微信支付回调
     *
     * @param transaction
     * @return
     */
    ResponseEntity payNotify(Transaction transaction);

}
